package com.fengmi.mapper;

import com.fengmi.dto.PageDTO;
import com.fengmi.entity.MallGoodsBrand;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Author 123
 * @Date 2022/2/10 11:13
 * @Version 1.0
 */


/**
 * 商品接口
 */
public interface GoodsBrandMapper {
    //品牌分页查询及条件查询
    List<MallGoodsBrand> findBrandByPage(MallGoodsBrand mallGoodsBrand);

    //添加品牌
    @Insert("insert into mall_goods_brand (name,first_letter,sort,show_status,logo) " +
            "values (#{name},#{firstLetter},#{sort},#{showStatus},#{logo})")
    public int insertBrand(MallGoodsBrand mallGoodsBrand);

    //查询某一个品牌
    @Select("select * from mall_goods_brand where id = #{id}")
    public MallGoodsBrand getOneBrandById(String id);

    //修改品牌的显示状态
    public int updateBrandStatusById(@Param("id") String id,@Param("status") Integer status);

    //通过品牌id删除品牌信息
    @Delete("delete from mall_goods_brand where id = #{id}")
    public int delBrandByBrandId(String id);

    //修改品牌信息
    public int updateBrandInfo(MallGoodsBrand mallGoodsBrand);

    //批量删除
    public int delMore(Integer[] ids);

    //查询所有品牌
    @Select("select * from mall_goods_brand")
    public List<MallGoodsBrand> findAllBrand();
}
